#include"shm.hpp"

int main()
{
    //创建共享内存
    int shmid = creatshm();
    //将共享内存和进程关联起来
    char* shmem = (char*)shmat(shmid, nullptr, 0);

    while(true)
    {
        std::cout << "client say:" << shmem << std::endl;
        sleep(1);
    }

    //断连
    shmdt(shmem);
    //删除共享内存
    delshm(shmid);
    return 0;
}